# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.MigrationCenter.V1.Model.Asset do
  @moduledoc """
  An asset represents a resource in your environment. Asset types include virtual machines and databases.

  ## Attributes

  *   `assignedGroups` (*type:* `list(String.t)`, *default:* `nil`) - Output only. The list of groups that the asset is assigned to.
  *   `attributes` (*type:* `map()`, *default:* `nil`) - Generic asset attributes.
  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The timestamp when the asset was created.
  *   `insightList` (*type:* `GoogleApi.MigrationCenter.V1.Model.InsightList.t`, *default:* `nil`) - Output only. The list of insights associated with the asset.
  *   `labels` (*type:* `map()`, *default:* `nil`) - Labels as key value pairs.
  *   `machineDetails` (*type:* `GoogleApi.MigrationCenter.V1.Model.MachineDetails.t`, *default:* `nil`) - Output only. Asset information specific for virtual and physical machines.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. The full name of the asset.
  *   `performanceData` (*type:* `GoogleApi.MigrationCenter.V1.Model.AssetPerformanceData.t`, *default:* `nil`) - Output only. Performance data for the asset.
  *   `sources` (*type:* `list(String.t)`, *default:* `nil`) - Output only. The list of sources contributing to the asset.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The timestamp when the asset was last updated.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :assignedGroups => list(String.t()) | nil,
          :attributes => map() | nil,
          :createTime => DateTime.t() | nil,
          :insightList => GoogleApi.MigrationCenter.V1.Model.InsightList.t() | nil,
          :labels => map() | nil,
          :machineDetails => GoogleApi.MigrationCenter.V1.Model.MachineDetails.t() | nil,
          :name => String.t() | nil,
          :performanceData => GoogleApi.MigrationCenter.V1.Model.AssetPerformanceData.t() | nil,
          :sources => list(String.t()) | nil,
          :updateTime => DateTime.t() | nil
        }

  field(:assignedGroups, type: :list)
  field(:attributes, type: :map)
  field(:createTime, as: DateTime)
  field(:insightList, as: GoogleApi.MigrationCenter.V1.Model.InsightList)
  field(:labels, type: :map)
  field(:machineDetails, as: GoogleApi.MigrationCenter.V1.Model.MachineDetails)
  field(:name)
  field(:performanceData, as: GoogleApi.MigrationCenter.V1.Model.AssetPerformanceData)
  field(:sources, type: :list)
  field(:updateTime, as: DateTime)
end

defimpl Poison.Decoder, for: GoogleApi.MigrationCenter.V1.Model.Asset do
  def decode(value, options) do
    GoogleApi.MigrationCenter.V1.Model.Asset.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.MigrationCenter.V1.Model.Asset do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
